package org.pentaho.di.core.database.util;

/**
 * @author tanp@yzbdl.ac.cn
 */
public enum DriverNameDict {
    NONE("无数据库", "NONE", 0),
    MYSQL("MySQL数据库", "MYSQL", 1),
    ORACLE("Oracle数据库", "ORACLE", 2),
    AS400("AS/400数据库", "AS/400", 3),
    ACCESS("Microsoft Access数据库", "ACCESS", 4),
    MSSQL("Microsoft SQL Server数据库", "MSSQL", 5),
    DB2("IBM DB2数据库", "DB2", 6),
    POSTGRES("PostgreSQL数据库", "POSTGRESQL", 7),
    CACHE("Intersystems Cache数据库", "CACHE", 8),
    INFORMIX("IBM Informix数据库", "INFORMIX", 9),
    SYBASE("Sybase ASE数据库", "SYBASE", 10),
    GUPTA("Gupta SQLBase数据库", "GUPTA", 11),
    DBASE("DBase III/IV/V数据库", "DBASE", 12),
    FIREBIRD("FireBird数据库", "FIREBIRD", 13),
    SAPDB("SAP DB数据库", "SAPDB", 14),
    HYPERSONIC("Hypersonic java数据库", "HYPERSONIC", 15),
    GENERIC("通用数据库", "GENERIC", 16),
    SAPR3("SAP R/3系统", "SAPR3", 17),
    INGRES("Ingress数据库", "INGRES", 18),
    INTERBASE("Borland Interbase数据库", "INTERBASE", 19),
    EXTENDB("ExtenDB数据库", "EXTENDB", 20),
    TERADATA("Teradata数据库", "TERADATA", 21),
    ORACLE_RDB("Oracle RDB数据库", "ORACLE_RDB", 22),
    H2("H2数据库", "H2", 23),
    NETEZZA("Netezza数据库", "NETEZZA", 24),
    UNIVERSE("IBM UniVerse数据库", "UNIVERSE", 25),
    SQLITE("SQLite数据库", "SQLITE", 26),
    DERBY("Apache Derby数据库", "DERBY", 27),
    REMEDY_AR_SYSTEM("BMC Remedy Action Request System", "REMEDY_AR_SYSTEM", 28),
    PALO("Palo MOLAP服务器", "PALO", 29),
    SYBASEIQ("SybaseIQ ASE数据库", "SYBASEIQ", 30),
    GREENPLUM("Greenplum数据库", "GREENPLUM", 31),
    MONETDB("MonetDB数据库", "MONETDB", 32),
    KINGBASEES("KingbaseES数据库", "KINGBASEES", 33),
    VERTICA("Vertica数据库", "VERTICA", 34),
    NEOVIEW("Neoview数据库", "NEOVIEW", 35),
    LUCIDDB("LucidDB数据库", "LUCIDDB", 36),
    INFOBRIGHT("Infobright数据库", "INFOBRIGHT", 37),
    VECTORWISE("Ingres VectorWise数据库", "VECTORWISE", 38),
    INFINIDB("Calpont InfiniDB数据库", "INFINIDB", 39),
    MSACCESS("MS Access数据库", "MSACCESS", 40),
    MARIADB("MariaDB数据库", "MARIADB", 41),
    MONDRIAN("Mondrian数据库", "MONDRIAN", 42),
    REDSHIFT("Redshift数据库", "REDSHIFT", 43),
    VERTICA5("Ingres VectorWise数据库", "VERTICA5", 44),
    MSSQLNATIVE("Microsoft SQL Server (Native)数据库", "MSSQLNATIVE", 45);

    // 名字
    private String name;
    // 英文名
    private String code;
    // 值
    private Integer value;

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public Integer getValue() {
        return value;
    }

    DriverNameDict(String name, String code, Integer value) {
        this.name = name;
        this.code = code;
        this.value = value;
    }

    /**
     * 根据code获取int值
     *
     * @param code
     * @return
     */
    public static Integer getValueByCode(String code) {
        DriverNameDict[] businessModeEnums = DriverNameDict.values();
        for (DriverNameDict driverNameDict : businessModeEnums) {
            if (driverNameDict.getCode().equals(code)) {
                return driverNameDict.getValue();
            }
        }
        return null;
    }


}